/**
 * NearShop
 * CommentListAction.java
 * com.android.nearshop.io.protocol.in
 * 
 */
package com.android.nearshop.io.protocol.in;

import android.util.Log;

import com.android.nearshop.io.protocol.out.CommentList;

/*********************************************************
 * @author : zhaohua
 * @version : 2012-8-11
 * @see : 根据参数，查询商家评论。
 * @Copyright : copyrights reserved by personal 2007-2012
 **********************************************************/
public class CommentListAction extends SoapAction<CommentList>
{
    public int curPage;
    public int pageNum;
	
    /**
     * 根据参数，查询商家评论。
     * @param shopId 商家Id
     * @param curPage 第几页的页码，[1,)
     * @param pageNum 每页的数量
     */
    public CommentListAction(int shopId, int curPage, int pageNum)
    {
        super(ACTION_TYPE.ACTION_SHOP,"commentList");
        addJsonParam("shopId", shopId+"");
        setPage(curPage, pageNum);
    }
    
    /** 设置分页信息*/
    public void setPage(int curPage, int pageNum)
    {
        addJsonParam("pageStruct",curPage+","+pageNum);
        this.pageNum = pageNum;
        this.curPage = curPage;
    }
    
    /* (non-Javadoc)
     * @see com.android.nearshop.io.protocol.in.SoapAction#parseJson(java.lang.String)
     */
    @Override
    protected CommentList parseJson(String response) throws Exception
    {
        Log.d(getMethod(), getMethod() + "response: \n " + response);
        CommentList res  = new CommentList();
        res.parseData(response);
        return res;
    }

}
